package com.delistry;

public class ShutDownHandler extends Thread {

	private static ShutDownHandler _instance;

	public static ShutDownHandler getInstance() {

		if (_instance == null) {
			_instance = new ShutDownHandler();
		}
		return _instance;
	}

	public ShutDownHandler() {
	}

	public void initialize() {
		Runtime.getRuntime().addShutdownHook(this);
		System.out.println("[shutdown handler] : initialized.");
	}

	@Override
	public void run() {
		System.out.println("shut down hooked!");
		///TODO Disconnect with db , if db is connected
	}

}
